<?php
namespace app\index\controller;
/**
 * Created by Submint Text.
 * User: hetaoren<452649510@qq.com>
 * Date: 2017/03/10
 * Explain: 角色控制器
 */
class Roles extends Base{
	
    public function index(){
    	return $this->fetch("list");
    }
    
    /**
     * 获取分页
     */
    public function pageQuery(){
    	return model('Roles')->pageQuery();
    }
    /**
     * 获取菜单
     */
    public function get(){
    	return model('Roles')->get(input('id/d',0));
    }
    /**
     * 跳去编辑页面
     */
    public function toEdit(){
    	$rs = model('Roles')->getById(input('id/d',0));
    	$this->assign("object",$rs);
    	return $this->fetch("edit");
    }
    /**
     * 新增菜单
     */
    public function add(){
    	return model('Roles')->add();
    }
    /**
     * 编辑菜单
     */
    public function edit(){
    	return model('Roles')->edit();
    }
    /**
     * 删除菜单
     */
    public function del(){
    	return model('Roles')->del();
    }
}
